package com.example.common.enums;

public enum AType {
    NetReferral(10, "在线复诊"),
    ImgText(11, "图文问诊"),
    Phone(12, "电话问诊"),
    Video(13, "视频问诊"),
    Drug(1, "药品"),
    ;

    private final Integer value;
    private final String description;

    AType(Integer value, String description) {
        this.value = value;
        this.description = description;
    }


    public Integer getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static AType valueByType(int svalue) {
        if (svalue == 10) {
            return NetReferral;
        } else if (svalue == 11) {
            return ImgText;
        } else if (svalue == 12) {
            return Phone;
        } else if (svalue == 13) {
            return Video;
        } else if (svalue == 1) {
            return Drug;
        }
        return null;
    }


    public static String valueToDesc(Integer value) {
        if (value == 10) {
            return NetReferral.getDescription();
        } else if (value == 11) {
            return ImgText.getDescription();
        } else if (value == 12) {
            return Phone.getDescription();
        } else if (value == 13) {
            return Video.getDescription();
        } else if (value == 1) {
            return Drug.getDescription();
        }
        return null;
    }


    public static AType valueToDescString(String values) {
        switch (values) {
            case "在线复诊":
                return NetReferral;
            case "图文问诊":
                return ImgText;
            case "电话问诊":
                return Phone;
            case "视频问诊":
                return Video;
            case "药品":
                return Drug;
            default:
                return null;
        }
    }
}
